<!DOCTYPE HTML>
<head>
<!-- Use IE7 mode -->
<meta http-equiv="X-UA-Compatible"
	content="IE=EmulateIE7 charset={$charset}" />
<meta http-equiv="Content-Type" content="text/html; charset={$charset}" />
<title></title>
<link href="templates/style/admin.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
//<!CDATA[
var SITE_URL = "{$site_url}";
var REAL_SITE_URL = "{$real_site_url}";
var REAL_BACKEND_URL = "{$real_backend_url}";
//]]>
</script>

<link rel="stylesheet" href="templates/css/layout.css" type="text/css" media="screen" />
<link rel="stylesheet" href="templates/css/helplayout.css" type="text/css" media="screen" />


<script src="templates/jsnew/jquery-1.7.1.min.js" type="text/javascript"></script>
<script src="templates/jsnew/hideshow.js" type="text/javascript"></script>

<script type="text/javascript" src="{lib file=ecmall.js}" charset="utf-8"></script>
<script type="text/javascript" src="{res file=js/admin.js}" charset="utf-8"></script>
<script type="text/javascript" src="{res file=js/jquery.cookie.js}" charset="utf-8"></script>
<script type="text/javascript" src="index.php?act=jslang"></script>

{$_head_tags}
<script src="templates/jsnew/jquery-ui-sliderAccess.js" type="text/javascript"></script>
<script src="templates/jsnew/jquery-ui-timepicker-addon.js" type="text/javascript"></script>
<link href="templates/css/jquery-ui-timepicker-addon.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="templates/js/jquery.colorbox.js"
	charset="utf-8"></script>
<link href="templates/style/colorbox.css" rel="stylesheet"
	type="text/css" />
<link href="templates/css/autocomplete.css" rel="stylesheet"
	type="text/css" />
<script src="templates/jsnew/autocomplete.js"> </script>
<style>
.syss{
display:none;
	position:fixed;
	top:0px;
	left:50%;
    width: 400px;
    height: 50px;
    line-height: 50px;
    background: #228B22;
    color: #fff;
    font-size: 16px;
    margin: 0 auto;
    margin-left:-200px;
    text-align: center;
    -webkit-border-bottom-left-radius: 4px;
    -moz-border-bottom-left-radius: 4px;
    border-bottom-left-radius: 10px;
    -webkit-border-bottom-right-radius: 4px;
    -moz-border-bottom-right-radius: 4px;
    border-bottom-right-radius: 10px;
    overflow: hidden;
}
.syse{
display:none;
    position:fixed;
	top:0px;
	left:50%;
    width: 400px;
    height: 50px;
    line-height: 50px;
    background: #FF4500;
    color: #fff;
    font-size: 16px;
    margin: 0 auto;
    margin-left:-200px;
    text-align: center;
    -webkit-border-bottom-left-radius: 4px;
    -moz-border-bottom-left-radius: 4px;
    border-bottom-left-radius: 10px;
    -webkit-border-bottom-right-radius: 4px;
    -moz-border-bottom-right-radius: 4px;
    border-bottom-right-radius: 10px;
    overflow: hidden;
	z-index: 1;
}
</style>
<script>
$(function(){
	var sysmsg=$.cookie('sysmsg');
	var syst=$.cookie('syst');
	if(sysmsg!=undefined&&sysmsg!=null&&sysmsg!=""){
		if(syst=='notice'){
			$("#syss").text(sysmsg);
			$("#syss").slideDown();
			
			setTimeout(function(){
				$("#syss").slideUp();
			},2000);
		}else{
			$("#syse").text(sysmsg);
			$("#syse").show();
			
			setTimeout(function(){
				$("#syse").slideUp();
			},4000);
		}
		
		$.cookie('sysmsg','');
		$.cookie('syst','');
	}
});
try{
var tabself = '{$tabself}';
window.parent.initTopTab1(tabself);

var tabback = '{$tabback}';
window.parent.initTopTab2(tabback);

	
}catch(e){}

function conblur(textid,lng,lat,mapimg){
	var v=$("#"+textid).val();
	var urlval=$("#"+textid).attr("urlval");
	if(v!=""&&v!=null){
		$.ajax({
			type: "GET",
			url: urlval,
			data: {q:v},
			dataType: "json",
			success: function(data){
				if(!data.done){
					$("#"+lng).val("");
					$("#"+lat).val("");
					$("#"+textid).val("");
				}else{
					$("#"+lng).val(data.retval.lng);
					$("#"+lat).val(data.retval.lat);
					$("#"+textid).val(data.retval.text);
					if(data.retval.lng>0&&data.retval.lat>0){
						$("#"+mapimg).attr("src","templates/images/newadmin/map1.png");
					}
				}
			}
		});
	}else{
		$("#"+lng).val("");
		$("#"+lat).val("");
		$("#"+textid).val("");
	}
}

function addrrefer(textid,lng,lat,mapimg){
	var url=$("#"+textid).attr("urldata");
	var urlval=$("#"+textid).attr("urlval");
	if(url==undefined||url==null||url==""||urlval==undefined||urlval==null||urlval==""){
		return;
	}

	AutoComplete({
		EmptyMessage: "没有数据",
		Url: url,
		_Select: function(item) {
			$("#"+textid).unbind("blur");
			$("#"+textid).val($(item).text());
			var lnglat = $(item).attr("data-autocomplete-value");
			var arr = lnglat.split(';');
			$("#"+lng).val(arr[0]);
			$("#"+lat).val(arr[1]);
			if(arr[0]>0&&arr[1]>0){
				$("#"+mapimg).attr("src","templates/images/newadmin/map1.png");
			}
			if((lng!=undefined&&lng!=""&&lng!=null) || (lat!=undefined&&lat!=""&&lat!=null)){
				var lnglat = $(item).attr("data-autocomplete-value");
				var arr = lnglat.split(';');
				$("#"+lng).val(arr[0]);
				$("#"+lat).val(arr[1]);
				if(arr[0]>0&&arr[1]>0){
					$("#"+mapimg).attr("src","templates/images/newadmin/map1.png");
				}
			}

			$("#"+textid).blur(function(){
				controlblur(textid,lng,lat,mapimg);
			});
		}
	}, "#"+textid);
}

function controlblur(textid,valueid){
	 var v=$("#"+textid).val();
	 var urlval=$("#"+textid).attr("urlval");
	 if(v!=""&&v!=null){
		 $.ajax({
             type: "GET",
             url: urlval,
             data: {q:v},
             dataType: "json",
             success: function(data){
             	if(!data.done){
             		$("#"+valueid).val(0);
       			 	$("#"+textid).val("");
             	}else{
             		//$("#"+valueid).val(data.retval.id);
       			 	//$("#"+textid).val(data.retval.text);
             	}
             }
         });
	 }else{
		 $("#"+valueid).val(0);
		 $("#"+textid).val("");
	 }
}

function refer(textid,valueid){
	 var url=$("#"+textid).attr("urldata");
	 var urlval=$("#"+textid).attr("urlval");
	 if(url==undefined||url==null||url==""||urlval==undefined||urlval==null||urlval==""){
		 return;
	 }
	 
	  AutoComplete({
        EmptyMessage: "没有数据",
        Url: url,//"index.php?app=waybill&act=gethz",
        _Select: function(item) {
        	$("#"+textid).unbind("blur");
        	$("#"+textid).val($(item).text());
        	if(valueid!=undefined&&valueid!=""&&valueid!=null){
        		$("#"+valueid).val($(item).attr("data-autocomplete-value"));
        	}
        	
        	$("#"+textid).blur(function(){
        		controlblur(textid,valueid);
        	});
        }
	 }, "#"+textid);
	  
	/* $("#"+textid).keydown(function(e){
		 if(e.keyCode==13){
			 var v=$(this).val();
			 if(v!=""&&v!=null){
				 $.ajax({
		             type: "GET",
		             url: urlval,
		             data: {k:v},
		             dataType: "json",
		             success: function(data){
		             	if(!data.done){
		             		$("#"+valueid).val(0);
		       			 	$("#"+textid).val("");
		             	}else{
		             		$("#"+valueid).val(data.retval.id);
		       			 	$("#"+textid).val(data.retval.text);
		             	}
		             }
		         });
			 }else{
				 $("#"+valueid).val(0);
				 $("#"+textid).val("");
			 }
		 }
	 });*/
}
</script>
</head>
<body>
<section class="section_maeginstyle" id="highchart" style="position: relative;">
	<div id="syss" class="syss">操作成功</div>
	<div id="syse" class="syse">操作失败</div>
    <article class="module width_full">